|
|
|
|
|
|
|
constants for this parameter, or you may leave it blank for the default button style. The last parameter is the Key or Index property of the image in the ImageList you want to use for this button. |
|
|
|
|
|
|
|
|
The Add method passes back a reference to the Button object that was just created. As you can see in the preceding routine, this value is placed in the oBtn variable thats declared as a Button object. You can then use this reference to set any of the other properties that are not exposed as parameters to the Add method. For example, you can set the ToolTipText property to a value thats appropriate for the button. |
|
|
|
|
|
|
|
|
Of course, you still need to write code in the ButtonClick event for the toolbar to have it respond to each of these buttons. You write this code as you did earlier: |
|
|
|
 |
|
|
|
|
Private Sub tbrMain_ButtonClick(ByVal Button As Button)
Select Case Button.Key
Case "NewRecord"
MsgBox "Add a new record here"
Case "SaveRecord"
MsgBox "Save changes here"
Case "DeleteRecord"
MsgBox "Delete a record here"
Case "UndoRecord"
MsgBox "Undo changes to a particular record"
Case "Exit"
Unload Me
End Select
End Sub |
|
|
|
|
|
|
|
|
The Coolbar control is used to contain bands of other controls. Each band can only contain one other control (see Figure 30.6). Youll typically use a container control on each band, such as a picture control or a toolbar. Theres not a lot of functionalitysuch as methods or eventsthat you need to program on the Coolbar; instead, you just set a few properties and write all the code on the contained control. |
|
|
|
|
|
|
|
|
Examples Filename: Coolbar.frm |
|
|
|
|
|